1. Field of the Invention
The present invention relates generally to an improved data processing system and in particular to, a computer implemented method, apparatus, and a computer program product for error detection and recovery using an asynchronous transaction journal.
2. Description of the Related Art
Asynchronous JavaScript and XML (AJAX), or Ajax, is a technique used by web application developers to create interactive web applications. The intent of the developers using AJAX is to make the resulting web pages more responsive by sending to and receiving from the server, small packets of data in the background eliminating the need to reload the entire web page each time a user requests a change. Use of AJAX typically increases the interaction, speed, function, and usability of a web page.
The advent of AJAX and Web 2.0 has enabled a new breed of highly dynamic, web-based applications. Web 2.0 may be viewed as considering the World Wide Web, or the Internet and the Web as an application platform. With such a platform there are associated “web services,” with ad serving as an example of a widely deployed web service. Many such applications now use AJAX to post changes in a hypertext markup language based user interface to server-side application logic. The response to these posted changes often contains instructions that are used to update the graphical user interface to reflect the resulting changes in the application's logic.
In these applications, it is reasonable to say that AJAX messages are used to synchronize changes in a hypertext markup language based graphical user interface with a server-based application environment. For example, in a hypertext markup language based time-sheet system, a hypertext markup language form representing a time sheet to a user might use AJAX to interact with server-side application logic to create a dynamic user experience. In such a system, user changes made to the hypertext markup language form, such as a change in the “hours worked” Monday, might be transmitted to the server and resulting graphical user interface changes, such as to the “total hours worked this week” field, would be propagated back down to the graphical user interface. As the user continues to work with the time-sheet graphical user interface, more messages are produced to propagate those changes to the server and the responses to the messages cause further updates to the timesheet graphical user interface.
Such systems provide a dynamic and interactive user experience, but have the potential to become unpredictable if the hypertext markup language based graphical user interface and the server-side logic are no longer synchronized. For example, a condition that may lead to a server-based application to no longer be synchronized with the associated hypertext markup language based graphical user interface is when an AJAX message becomes lost during transmission or execution. Network failure could make it impossible for an AJAX transaction to be completed. The network might fail either before or after the state of the server-side logic was updated. In this case, it may be possible for the server-side logic to no longer be synchronized with the state of the hypertext markup language display.
In another example, a server could fail in a clustered application scenario. When the application is a clustered application using several application servers and one of the servers fails before the failing server can propagate state information to the remaining servers in the cluster, there is a possibility that the hypertext markup language based graphical user interface and the state of the failover application server could no longer be synchronized.
In another example, a server could encounter an error during the processing of an AJAX request. Again, depending on the architecture of the application, this could cause the state of the server-side application to no longer be synchronized with the hypertext markup language based graphical user interface.
Clearly, AJAX-based Web 2.0 applications require a mechanism to help detect and recover from these failure conditions.